﻿@{ Layout = null; }

<!DOCTYPE html>
<html>
<head>
    <title>	1.常规盖章</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
</head>
<body>
    <div style="font-size: 12px; line-height: 20px; border-bottom: dotted 1px #ccc; border-top: dotted 1px #ccc; padding: 5px;">
        <span style="color: red;">操作说明：</span>点“加盖印章”按钮即可，插入印章时的用户名为：李志，密码默认为：111111或123456。
    </div>
    <br />
    <script type="text/javascript">
                function Save() {
                    var myObject = {};
                    myObject.folderName = "AddSeal1";
                    var params = new URLSearchParams(myObject);
                    var saveUrl = "/InsertSeal/Word/SaveFile";
                    pageofficectrl.SaveFilePage = `${saveUrl}?${params.toString()}`;
                    pageofficectrl.WebSave();

                }

				function InsertSeal() {
					try {
                        pageofficectrl.zoomseal.AddSeal();
					} catch(e) {}
				}

                function DeleteByName(){
                    let sealsJson = pageofficectrl.zoomseal.SealsAsJson;
                    let sealObj = JSON.parse(sealsJson);
                    for (var key in sealObj) {
                        let sealName = sealObj[key].name;
                        if ("李志签名" == sealName) {
                            pageofficectrl.zoomseal.DeleteByName(sealName);
                        }

                    }

				}

                function DeleteBySigner(){
                    let sealsJson = pageofficectrl.zoomseal.SealsAsJson;
                    let sealObj = JSON.parse(sealsJson);
                    for (var key in sealObj) {
                        let sealSigner = sealObj[key].signer;
                        if ("李志" == sealSigner) {
                            pageofficectrl.zoomseal.DeleteBySigner("李志");
                        }
                    }
                }

				function VerifySeal() {
                    pageofficectrl.zoomseal.VerifySeal();
				}

				function ChangePsw() {
                    pageofficectrl.zoomseal.ShowSettingsBox();
                }

                function OnPageOfficeCtrlInit() {
                    //添加自定义按钮
                    pageofficectrl.AddCustomToolButton("保存", "Save", 1);
                    pageofficectrl.AddCustomToolButton("加盖印章", "InsertSeal()", 2);
                    if (("linux") != (pageofficectrl.ClientOS)) {
                        pageofficectrl.AddCustomToolButton("删除名称为“李志签名”的印章", "DeleteByName()", 21);
                        pageofficectrl.AddCustomToolButton("删除用户为“李志”的所有印章", "DeleteBySigner", 21);
                        pageofficectrl.AddCustomToolButton("验证印章", "VerifySeal()", 5);
                        pageofficectrl.AddCustomToolButton("修改密码", "ChangePsw()", 0);
                    }
                }
    </script>
    <form id="form1" runat="server">
        <div style="width:auto; height: 900px;">
            @Html.Raw(ViewBag.poCtrl)
        </div>
    </form>
</body>

</html>
